package org.idea.spring.framework.event.multiEvent.service;

import org.idea.spring.framework.event.multiEvent.events.MyAsyncEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;

/**
 * @Author linhao
 * @Date created in 3:25 下午 2021/5/30
 */
@Service
public class EventTestService {

    @Autowired
    private ApplicationEventPublisher applicationEventPublisher;

    public void doSendMsg(){
        System.out.println(" ===== send ===== ");
        applicationEventPublisher.publishEvent(new MyAsyncEvent("this is async"));
    }
}
